﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    Inherits="Wjtour.Web.Front.scenicdetail" %>

<%@ Import Namespace="Wjtour.Domain" %>
<%@ Import Namespace="Wjtour.Common" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">

    <!--页主体-->
    <div class="ipage scenicpage">
        <img src="css/images/virtualtravell.png" class="vt" />

        <!-- 浮动块 -->
        <div class="scenicleft scenicdetailleft">
            <%if (data != null)
              {
                  Title = data.scenename;
            %>
            <div class="path dpath">您所在的位置：<a href="/">首页</a> &gt; 景区景点 &gt; <%=data.scenename %> </div>
            <h1><%=data.scenename %></h1>
            <div class="scenicinfo">
                <%if (!string.IsNullOrEmpty(data.img))
                  {%>
                <img src="<%=data.img %>" />
                <%} %>
                <ul>
                    <li>景区星级：<span><%=Utility.GetStarHtml(data.scenerank) %> </span></li>
                    <li>所属片区：<%=scenetype %></li>
                    <%if (data.price > 0)
                      { %>
                    <li>挂 牌 价：<span>￥<%=data.price %> </span></li>
                    <%} %>
                    <%if (!string.IsNullOrEmpty(data.contactphone))
                      { %>
                    <li>咨询电话：<%=data.contactphone %> </li>
                    <%} %>
                    <%if (!string.IsNullOrEmpty(data.address))
                      { %>
                    <li>景区地址：<%=data.address %> </li>
                    <%} %>
                    <%if (!string.IsNullOrEmpty(data.sceneweb))
                      { %>
                    <li>网址：<%=data.sceneweb %> </li>
                    <%} %>
                </ul>
            </div>
            <div class="clear" style="height: 20px;"></div>
            <!-- 详细内容 -->
            <ul class="nav nav-tabs" id="myTab">
                <li class="active"><a href="#scenicwords" data-toggle="tab" data-index="0">景区简介</a></li>
                <li><a href="#scenicimg" data-toggle="tab" data-index="1">美图体验</a></li>
                <li><a href="#scenictraffic" data-toggle="tab" data-index="2">交通指南</a></li>
                <li><a href="#scenicfood" data-toggle="tab" data-index="3">附近餐饮</a></li>
                <li><a href="#scenichotel" data-toggle="tab" data-index="4">周边住宿</a></li>
            </ul>

            <div class="tab-content">
                <!--tab1-->
                <div class="tab-pane active" id="scenicwords">
                    <p><%=data.introduce %></p>
                </div>
                <!--tab2-->
                <div class="tab-pane" id="scenicimg">
                    <ul>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li class="last">
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li class="last">
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li>
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                        <li class="last">
                            <div>
                                <span>
                                    <img src="css/images/tmp07.png" /></span>
                            </div>
                            美图</li>
                    </ul>

                    <!-- 分页 -->
                    <div class="pagecut">
                        <span class="pagecount">共25页</span>
                        <span class="home">首页</span>
                        <span class="prepage">上一页</span>
                        <span class="thispage">1</span>
                        <span class="pagenum">2</span>
                        <span class="pagenum">3</span>
                        <span class="nextpage">下一页</span>
                        <span class="endpage">末页</span>
                    </div>
                </div>
                <!--tab3-->
                <div class="tab-pane" id="scenictraffic">
                    <div id="maps">
                        <iframe width="650" height="323" scrolling="no" frameborder="0" src="map.aspx?type=scene&id=<%=id %>"></iframe>
                    </div>
                    <div class="traffic">
                        <%=data.trafficguide %>
                    </div>
                </div>
                <!--tab4-->
                <div class="tab-pane" id="scenicfood">
                    <ul>
                    </ul>

                    <!-- 分页 -->
                    <div class="pagecut">
                    </div>
                </div>
                <!--tab5-->
                <div class="tab-pane" id="scenichotel">
                    <ul>
                    </ul>

                    <!-- 分页 -->
                    <div class="pagecut">
                    </div>
                </div>
            </div>
            <%} %>
        </div>
        <!-- 侧面-->
        <div class="scenicright scenicdetailright">
            <img src="css/images/linecommend.png" />
            <div class="title"></div>
            <ul class="arlist">
                <%if (recommendLines != null && recommendLines.Count > 0)
                  {
                      for (var i = 0; i < recommendLines.Count; i++)
                      {
                          var line = recommendLines[i];
                %>

                <li><span></span><a href="traveldetail.aspx?id=<%=line.id %>" target="_blank"><%=line.title %></a></li>
                <%}
                  }%>
            </ul>

            <img src="css/images/guide.png" class="guide" />

            <h5>
                <img src="css/images/travelguide.png" />
                <span>MORE</span>
            </h5>
            <div class="title"></div>
            <%if (trafficGuides != null && trafficGuides.Count > 0)
              {
                  var first = trafficGuides.First();
            %>
            <div class="best">
                <%if (!string.IsNullOrEmpty(first.img))
                  { %>
                <img src="<%=first.img %>" />
                <%}
                  else
                  { %>
                <img src="css/images/tmp13.png" />
                <%} %>
                <div>
                    <h4><a href="traveldetail.aspx?id=<%=first.id %>" target="_blank"><%=first.title %></a></h4>
                    <span>作者：<%=first.author %></span>
                    <span class="goodnum">赞：<%=first.zan %></span>
                    <span class="readnum">浏览：<%=first.hits %></span>
                </div>
            </div>
            <ul class="arlist">
                <%for (var i = 1; i < trafficGuides.Count; i++)
                  {
                      var tg = trafficGuides[i];
                %>
                <li><span></span><a href="travelguideview.aspx?id=<%=tg.id %>" target="_blank"><%=tg.title %></a></li>
                <%} %>
            </ul>
            <%} %>
        </div>
        <div class="clear"></div>
    </div>

    <script language="javascript">
        $(document).ready(function () {
            $('#myTab a:first').tab('show');
            $('#myTab a').click(function (e) {
                e.preventDefault();
                $(this).tab('show');
                var index = parseInt($(this).data("index"));
                switch (index) {
                    case 1:
                        $("#scenicimg ul").empty();
                        calldata('scenepicture.ashx', 1, 1);
                        break;
                    case 3:
                        calldata('sceneresturant.ashx', 1, 3);
                        break;
                    case 4:
                        calldata('scenehotel.ashx', 1, 4);
                        break;
                    default:
                        break;
                }
            });
        });

        function calldata(url, page, type) {
            $.ajax({
                url: url,
                data: { 'page': page, 'sceneid': '<%=id%>' },
                dataType: 'json',
                success: function (d) {
                    if (type == 1) {
                        $("#scenicimg ul").empty();
                    }

                    if (type == 3) {
                        $("#scenicfood ul").empty();
                    }

                    if (type == 4) {
                        $("#scenichotel ul").empty();
                    }

                    for (var i = 0; i < d.Datas.length; i++) {
                        var p = d.Datas[i];
                        if (type == 1) {
                            var html = "";
                            html += "<li>";
                            html += "<div>";
                            html += "<span><img src=\"" + p.smallImg + "\" style=\"width: 138px;height: 99px;\"/></span>";
                            html += "</div>";
                            html += "</li>";
                            $("#scenicimg ul").append(html);

                        }
                        if (type == 3) {
                            var html = "";
                            html += "<li>";
                            html += "<a href=\"restdetail.aspx?id=" + p.id + "\" target=\"_blank\"><img src=\"" + p.img + "\" style=\"width: 138px;height: 99px;\"/></a>";
                            html += "<div>";
                            html += "	<h4><a href=\"restdetail.aspx?id=" + p.id + "\" target=\"_blank\">" + curStr(p.resturantname, 11) + "</a></h4>";
                            html += "	<span>人均消费：" + p.averagecosume + "元</span>";
                            html += "	<span>地址：" + curStr(p.address, 11) + "</span>";
                            html += "	<span>电话：" + p.contactphone + "</span>";
                            html += "</div>";
                            html += "</li>";
                            $("#scenicfood ul").append(html);

                        }
                        if (type == 4) {
                            var html = "";
                            html += "<li>";
                            html += "<a href=\"travelhoteldetail.aspx?id=" + p.id + "\" target=\"_blank\"><img src=\"" + p.img + "\" style=\"width: 138px;height: 99px;\"/></a>";
                            html += "<div>";
                            html += "	<h4><a href=\"travelhoteldetail.aspx?id=" + p.id + "\" target=\"_blank\">" + curStr(p.hotelname, 11) + "</a></h4>";
                            html += "	<span>酒店等级：五星级酒店</span>";
                            html += "	<span>地址：" + curStr(p.address, 11) + "</span>";
                            html += "	<span>电话：" + p.reservephone + "</span>";
                            html += "</div>";
                            html += "</li>";
                            $("#scenichotel ul").append(html);
                        }
                    }

                    if (type == 1) {
                        $("#scenicimg .pagecut").empty();
                        $("#scenicimg .pagecut").html(d.PagnationHtml);
                        $("#scenicimg .pagecut a").click(function (e) {
                            e.preventDefault();
                            var path = $(this).data("url");
                            var page = path.split('=')[path.split('=').length - 1];
                            calldata(url, page, 1);
                        });
                    }
                    if (type == 3) {
                        $("#scenicfood .pagecut").empty();
                        $("#scenicfood .pagecut").html(d.PagnationHtml);
                        $("#scenicfood .pagecut a").click(function (e) {
                            e.preventDefault();
                            var path = $(this).data("url");
                            var page = path.split('=')[path.split('=').length - 1];
                            calldata(url, page, 3);
                        });
                    }
                    if (type == 4) {
                        $("#scenichotel .pagecut").empty();
                        $("#scenichotel .pagecut").html(d.PagnationHtml);
                        $("#scenichotel .pagecut a").click(function (e) {
                            e.preventDefault();
                            var path = $(this).data("url");
                            var page = path.split('=')[path.split('=').length - 1];
                            calldata(url, page, 4);
                        });
                    }

                }
            });
        }
    </script>
</asp:Content>
